#!/bin/bash

source $1/etc/xrootd/system.cnf

if [ `uname -m` = "x86_64" ]; then
        bit="64"
else
        bit=""
fi

export PERL5LIB=$1/lib$bit

if [ "x${LD_LIBRARY_PATH}" = "x" ]; then
    export LD_LIBRARY_PATH=$1/lib$bit
else
    export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$1/lib$bit
fi

if [ "x${PATH}" = "x" ]; then
    export PATH=$1/bin
else
    export PATH=${PATH}:$1/bin
fi

export XRDBASEDIR=$1

$2 $3 $4 $5 $6 $7
